<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>编辑指定的任务</title>
    <% include ../../layouts/import.ejs %>
</head>
<body>
<table class="remarks-table">
    <input type="hidden" id="id" value="<%= schedule.id %>" name="id"/>
    <tr>
        <td>
            <span class="renwu">任务名称:</span>
        </td>
        <td colspan="3">
            <input type="text" id="task_title" value="<%= schedule.task_title %>">
        </td>
    </tr>
    <tr>
        <td>
            <span class="renwu">执行人:</span>
        </td>
        <td>
            <select class="remarks-select" id="transactor">
                <% for(var i = 0; i < userList.length; i++) { %>
                <option value="<%= userList[i].id %>" class="option-color" <%= userList[i].id==schedule.transactor?'selected="selected"':'' %> ><%= userList[i].person_name %></option>
                <% } %>
            </select>
        </td>
        <td>
            <span class="renwu">任务状态:</span>
        </td>
        <td>
            <select class="remarks-select" id="task_status" value="<%= schedule.task_status %>">
                <option value="紧急" class="option-color" <%= '紧急'==schedule.task_status?'selected="selected"':'' %>>紧急</option>
                <option value="一般" class="option-color" <%= '一般'==schedule.task_status?'selected="selected"':'' %>>一般</option>
                <option value="普通" class="option-color" <%= '普通'==schedule.task_status?'selected="selected"':'' %>>普通</option>
            </select>

        </td>
    </tr>
    <tr>
        <td>
            <span class="renwu">任务描述:</span>
        </td>
        
        <td colspan="3">
            <textarea name="" id="task_description"><%= schedule.task_description %></textarea>
        </td>
    </tr>
     <tr>
         <td >
             <span class="renwu">开始时间:</span>
         </td>
         <td>
             <div class="input-group">
                 <div class="input-group-addon"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></div>
                 <input type="text" class="dpd1" data-date-format="yyyy-mm-dd" id="start_time" value="<%= schedule.start_time %>">
             </div>
         </td>
         <td >
             <span class="renwu" style="width: 95%">结束时间:</span>
         </td>
         <td>
             <div class="input-group">
                 <div class="input-group-addon"><span class="glyphicon glyphicon-calendar" aria-hidden="true"></span></div>
                 <input type="text" class="dpd2" data-date-format="yyyy-mm-dd" id="end_time" value="<%= schedule.end_time %>">
             </div>
         </td>
     </tr>

     <!--<tr>
         <td >
             <span>任务级别</span>
         </td>
         <td>
             <input type="text">
         </td>
         <td >
             <span>任务详细</span>
         </td>
         <td>
             <input type="text">
         </td>
     </tr>-->
</table>
<script>
   // 日期选择

    var nowTemp = new Date();
    var now = new Date(nowTemp.getFullYear(), nowTemp.getMonth(), nowTemp.getDate(), 0, 0, 0, 0);
    var checkin = $('.dpd1').fdatepicker({
        onRender: function (date) {
            return date.valueOf() < now.valueOf() ? 'disabled' : '';
        }
    }).on('changeDate', function (ev) {
        if (ev.date.valueOf() > checkout.date.valueOf()) {
            var newDate = new Date(ev.date)
            newDate.setDate(newDate.getDate() + 1);
            checkout.update(newDate);
        }
        checkin.hide();
        $('.dpd2')[0].focus();
    }).data('datepicker');
    var checkout = $('.dpd2').fdatepicker({
        onRender: function (date) {
            return date.valueOf() <= checkin.date.valueOf() ? 'disabled' : '';
        }
    }).on('changeDate', function (ev) {
        checkout.hide();
    }).data('datepicker');

//////////////////

</script>
</body>
</html>